package com.learner.course.controller.api;

import com.learner.course.service.CoursePlanService;
import com.learner.pojo.course.expand.CoursePlanNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ice2020x
 * @date 2022-01-27 19:21
 * @description:
 */
@RestController
@RequestMapping("/api/edu/course")
public class ApiCoursePlanController {
    @Autowired
    CoursePlanService coursePlanService;

    /**
     * 查询课程计划的接口
     *
     * @param courseId 课程id
     * @return 结果
     */
    @GetMapping("/course_plan/list/{courseId}")
    public CoursePlanNode findCoursePlanList(@PathVariable("courseId") String courseId) {
        return coursePlanService.findCoursePlanListByCourseId(courseId);
    }
}
